package cn.jingyuan.swan.system.service;

import cn.jingyuan.swan.system.domain.sys.entity.App;
import cn.jingyuan.swan.system.model.ClientDetails;
import org.springframework.security.oauth2.provider.client.BaseClientDetails;

import java.util.List;

public interface AppService {

    App addAppInfo(App app);

    void removeApp(String appId);

    App updateInfo(App app);

    void updateAppClientInfo(BaseClientDetails client);

    /**
     * 重置应用密匙
     *
     * @param appId 应用 id
     *
     * @return
     */
    String restSecret(String appId);

    /**
     * 获取应用信息
     *
     * @param appId 应用 id
     *
     * @return
     */
    App getAppInfo(String appId);

    /**
     * 获取所有应用信息
     *
     * @return 应用
     */
    List<App> getAppsInfo();

    /**
     * 获取客户端信息
     *
     * @param clientId client id
     *
     * @return {@link org.springframework.security.oauth2.provider.ClientDetails} 客户端信息
     */
    BaseClientDetails getBaseClientDetails(String clientId);

    /**
     * 获取客户端信息
     *
     * @param clientId client id
     *
     * @return {@link org.springframework.security.oauth2.provider.ClientDetails} 客户端信息
     */
    ClientDetails getSysClientDetails(String clientId);

}
